package com.weic.easycache.exception;

import com.weic.easycache.framework.web.ApiStatus;

public class ApiStatusException extends Exception {
	private static final long serialVersionUID = -4462409358336560613L;
	private ApiStatus status;
	
	public ApiStatusException(ApiStatus status) {
		this.status = status;
	}
	
	public int getCode() {
		return status.code;
	}
	
	@Override
	public String getMessage() {
		return status.message;
	}
	
	@Override
	public String getLocalizedMessage() {
		return toString();
	}
	
	@Override
	public String toString() {
		return "message:"+getMessage()+", status:"+getCode();
	}
}
